//
//  UIImageView+OSHelp.m
//  UniversalApp
//
//  Created by 凯朱 on 2019/7/2.
//  Copyright © 2019 徐阳. All rights reserved.
//

#import "UIImageView+OSHelp.h"

@implementation UIImageView (OSHelp)
#pragma mark - ————— 图片设置 —————

/**
 设置图片
 */
-(void)zc_setImageWithUrlStr:(NSString *)urlStr{
     NSString *url = kSTRING(urlStr);
    if (url.length == 0) {
        self.image = kDefaultImage;
        return;
    }
    NSString *imageUrl = @"";
    if ([url hasPrefix:@"http://"] || [url hasPrefix:@"https://"]) {
        imageUrl = url;
    }else{
        imageUrl = [NSString stringWithFormat:@"%@/%@",ROOT_IMAGE,urlStr];
    }
    [self sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:kDefaultImage];
}
@end
